1. Field of the Invention
This invention relates to determining the consistency of a database and more particularly relates to determining the consistency of a database in which a data element is referenced indirectly.
2. Description of the Related Art
A hierarchical database system (for example, IBM IMS DL/I or IMS) manages data elements by means of a tree structure. In this database, a minimum unit of data is referred to as a data element and a data element located at the highest level of a tree structure is referred to as a root element. A root element has one or more dependent elements which, in turn, have further dependent elements. Specifically, each data element has one or more pointers designating storage addresses of dependent elements. A storage address of each data element may be designated by a relative byte address (RBA), which is an address value relative to a specific address of a partition recording a database.
Such a tree structure is usually formed in a single partition. However, when a large database is constructed, its tree structure may be formed in plural partitions by establishing an association or logical relationship between the partitions. One example of a database realizing this association is HALDB (IMS High Availability Large Database). The HALDB realizes the association by means of indirect list elements. See, for example, U.S. Pat. No. 5,933,820 and “The Complete IMS HALDB Guide: All You Need to Know to Manage HALDBS”, URL http://www.redbooks.ibm.com/redbooks/pdfs/sg246945.pdf.
A database can improve access efficiency by means of a reorganization operation such as compaction or defragmentation. Since this reorganization operation rerecords a plurality of dispersed data elements in continuous areas, storage addresses of data elements may be changed. A reorganization operation can be performed for each partition regardless of the logical relationship between the partitions. Therefore, in a database stored in a plurality of partitions, if dependency between data elements is designated by storage addresses, a tree structure before a reorganization operation cannot be appropriately maintained after the reorganization operation.
For this reason, according to HALDB, an indirect list element is recorded in a database in association with each data element, which includes a storage address of that data element so that other data elements can reference that data element. A referencing data element (hereinafter referred to as a source data element) has not only a storage address of a data element to be referenced (hereinafter referred to as a target data element) but also identification information of an indirect list element corresponding to the target data element so that the source data element can reference the target data element.
As a reorganization operation is performed in a partition to which a target data element belongs, a storage address in an indirect list element is updated to an appropriate storage address after the reorganization operation. By referencing the indirect list element, a storage address of a target data element included in a source data element can be updated to an appropriate value after the reorganization operation.
In a database reorganization operation, change of database definition, deletion of a data element, and/or change of partitioning may be performed in addition to change of a recording position of a data element. Thus, when a configuration of a database is changed, it is desirable to confirm whether dependency between data elements is appropriately maintained. This confirmation is realized by determining consistency of the database.
Two check types, i.e., a hash check and a full check are used to determine the consistency. In case of a hash check, a database management system (DBMS) reads, from each data element, an RBA of a data element to be referenced to generate a hash value. The DBMS also reads an RBA of each data element to generate a hash value. Then, the DBMS determines that the database is consistent on condition that the generated hash values are equivalent to each other.
If the hash values are not equivalent to each other, a full check is performed. The DBMS reads, from each data element, an RBA of a data element to be referenced, reads an RBA of each data element, and determines whether these are equivalent to each other. In this way, it is possible to appropriately determine not only whether the database is consistent but also inconsistent positions, if any. However, for a database adopting indirect list elements, no method has been proposed to effectively determine consistency of that database. From the foregoing discussion, it should be apparent that a need exists for an apparatus, system, and method to determine the consistency of a database. Beneficially, such an apparatus, system, and method would determine the consistency of a database that includes indirect list elements.